<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>SQL 对象</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="../assets/global/plugins/layui/css/layui.css"/>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>添加SQL对象</legend>
</fieldset>

<div class="form">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">名称：</label>
                <div class="layui-input-inline">
                    <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:100px;">所属数据源：</label>
                <div class="layui-input-inline">
                    <label class="layui-form-label" style="width:100px;">ceshi</label>
                </div>
            </div>
            <div class="layui-inline" style="width: 47.1%;">
                <div class="layui-input-inline" style="float: right;width: 70px;">
                   <button type="reset" class="layui-btn layui-btn-warm">执行</button>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">SQL：</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" style="width: 80%;display: inline;"></textarea>
            </div>
        </div>

        <div class="layui-form-item" style="width: 75.5%;margin-left: 110px;">
            <div class="selectData_table">
                <table class="layui-hide" id="test"></table>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">下一步</button>
                <button type="reset" class="layui-btn layui-btn-primary">取消</button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../assets/global/plugins/layui/layui.all.js"></script>
<script>
    layui.use('table', function () {
        var table = layui.table;

        table.render({
            elem: '#test'
            , url: 'test.json'
            //  ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            , cols: [[
                {field: 'id', width: 100, title: 'C1', sort: true, class: 'fa fa-check'}
                , {field: 'username', width: 100, title: 'C2'}
                , {field: 'sex', width: 100, title: 'C3'}
                , {field: 'city', width: 100, title: 'C4'}//minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
            ]],
            done: function () {
                $('th[data-field="id"]').children().prepend($('<i style="color: #95A5A6;">123</i><i class="icon-key"></i>'));
                $('th[data-field="username"]').children().prepend($('<i style="color: #95A5A6;">abc</i><i style="color: #95A5A6;">T/N</i> '));
                $('th[data-field="sex"]').children().prepend($('<i class="icon-calendar"></i> '));
                $('th[data-field="city"]').children().prepend($(' <i style="color: #95A5A6;">0101</i>'));
                $('.layui-table').css('width', '100%');
            }
        });
    });
</script>
</html>